package io.renren.modules.api.controller;

import io.renren.common.utils.R;
import io.renren.modules.api.annotation.AuthIgnore;
import io.renren.modules.areainfos.entity.AreainfosEntity;
import io.renren.modules.areainfos.service.AreainfosService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.*;

/**
 * @Title: stf
 * @Description: java类作用描述
 * @Author: 杨帅
 * @CreateDate: 2018/10/31 17:37
 * @Version: 1.0
 */
@RestController
@RequestMapping("/api/areainfo")
public class ApiAreainfoController {
    @Autowired
    private AreainfosService areainfosService;

        /**
         * 获取地区列表
         */
        @AuthIgnore
        @GetMapping("/getAreainfoList")
        public R getAreainfoList(Integer columnid){
            if (columnid == null){
                columnid = 0;
            }
            List<AreainfosEntity> areainfosEntities = areainfosService.apiQueryByParentId(columnid);
            return R.ok().put("data",areainfosEntities);
    }

}
